// 狗秀

#include <iostream>
#include <stdlib.h>
using namespace std;

enum Breed {
    Breed_husky,
    Breed_heeler,
    Breed_shepherd,
    Breed_pointer,
    Breed_chow,
    Breed_terrier,
    Breed_other,
};

struct Name {
    char first[15];
    char last[15];
};

struct Dog {
    char fido_name[15];
    Breed type;
    int age;
};

struct Contestant {
    Name owner;
    Dog fido;
};

void AskUser4Info(Contestant* joe, char breeds[][15]);
void WriteInfo(Contestant joe, char breeds[][15]);

int main() {
    Contestant joe;

    char breeds[7][15] = {
        "husky",
        "heeler",
        "shepherd",
        "pointer",
        "chow",
        "terrier",
        "other",
    };

    AskUser4Info(&joe, breeds);
    WriteInfo(joe, breeds);

    cout << "完毕\n";
}

void AskUser4Info(Contestant* joe, char breeds[][15]) {
    cout << "请输入主人的名字: ";
    cin.getline(joe->owner.first, 25);

    cout << "请输入主人的姓氏: ";
    cin.getline(joe->owner.last, 25);

    cout << "请输入狗的名字: ";
    cin.getline(joe->fido.fido_name, 40);

    char buf[20];

    cout << "请输入狗的年龄: ";
    cin.getline(buf, 20);
    joe->fido.age = atoi(buf);

    for (int i = 0; i < 7; i++) {
        cout << (i+1) << " " << breeds[i] << "\n";
    }

    cout << "请选择狗的品种: ";
    cin.getline(buf, 20);
    int choice = atoi(buf);

    joe->fido.type = (Breed)(choice-1);
}

void WriteInfo(Contestant joe, char breeds[][15]) {
    cout << "你输入的信息如下:\n"
        << "主人: " << joe.owner.first << " " << joe.owner.last << "\n"
        << "狗名: " << joe.fido.fido_name << "\n"
        << "狗龄: " << joe.fido.age << "\n"
        << "狗种: " << breeds[joe.fido.type] << "\n";
}